#include "StdAfx.h"
#include "cPlayGame.h"

cPlayGame::cPlayGame( )
{
	mGameSetup = new cGameSetup;
	GAMESTATE  = INIT;
}
//---------------------------------------------------------------------------------------------------------------------------------------
cPlayGame::~cPlayGame( void )
{
	SAFE_DELETE( mGameSetup );
}
//---------------------------------------------------------------------------------------------------------------------------------------
void cPlayGame::SafeDelete( )
{
	mGameSetup->safeDelete();
}
//---------------------------------------------------------------------------------------------------------------------------------------
void cPlayGame::OnLoadModel( )
{
	mGameSetup->loadModel( );
}
//---------------------------------------------------------------------------------------------------------------------------------------
void cPlayGame::OnLoadUI()
{
	mGameSetup->loadInterface(); 
}
//---------------------------------------------------------------------------------------------------------------------------------------
void cPlayGame::OnUpdate( float dtTime )
{
	mGameSetup->Update_UI("start");

	if ( GAMESTATE == START )
	{
		mGameSetup->Update( dtTime, "start" );	
		mGameSetup->Update_UI("play");
	}
}
//---------------------------------------------------------------------------------------------------------------------------------------
void cPlayGame::ModelRender( bool bDraw )
{
	switch ( GAMESTATE )
	{
		case INIT:
		{
			mGameSetup->drawInterface( "start" );
			
			if ( gDInput->keyDown( DIK_SPACE ) )
			{
				GAMESTATE = START;
			}
		}
		break;

		case START:
		{
			mGameSetup->renderModel( bDraw, "start" );
			mGameSetup->drawInterface( "play" );
		}
		break;

		case STOP:
 		{
		}
		break;

		case END:
		{
		}
		break;
		
		case EXIT:
		{
		}
		break;

	}
}
//---------------------------------------------------------------------------------------------------------------------------------------
